package com.bl.student.dao.model;

import com.bl.student.common.enums.SalivaActionType;
import com.bl.student.dao.model.converter.DatetimeConverter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * Created by yujingyi on 2018/3/17.
 */
@Entity
@Data
@Table(name = "SALIVA_HISTORY")
@ApiModel(value = "SalivaHistoryEntity", description = "口水变更历史记录表")
@DynamicInsert
@DynamicUpdate
public class SalivaHistoryEntity {
    @Id
    @ApiModelProperty(value = "id")
    private String id;

    @ApiModelProperty(value = "用户id")
    @Column(name = "user_id")
    private String userId;

    @ApiModelProperty(value = "变理数量")
    private String amount;

    @ApiModelProperty(value = "手机号")
    private SalivaActionType action;

    @ApiModelProperty(value = "业务id")
    @Column(name = "biz_id")
    private String bizId;

    @ApiModelProperty(value = "修改时间")
    @Column(name = "update_time")
    @Convert(converter = DatetimeConverter.class)
    private Long updateTime;
}
